<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<meta name="Generator" content="EditPlus®">
	<meta name="Author" content="">
	<meta name="Keywords" content="">
	<meta name="Description" content="">
	<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
	<meta name="renderer" content="webkit">
	<title>登录淘淘商城</title>
    <link rel="stylesheet" th:href="@{/theme/css/base.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/theme/css/login.css}">
	<link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <script th:src="@{/theme/js/jquery-3.1.1.min.js}"></script>
	<script th:src="@{/layui/layui.all.js}"></script>
	<script type="text/javascript" th:src="@{/theme/js/encrypt/aes.js}"></script>
	<script type="text/javascript" th:src="@{/theme/js/encrypt/jsencrypt.min.js}"></script>
	<script type="text/javascript" th:src="@{/theme/js/encrypt/pad-zeropadding.js}"></script>
	<script type="text/javascript" th:src="@{/theme/js/encrypt/security.js}"></script>
	<script type="text/javascript" th:src="@{/theme/js/encrypt/random.js}"></script>
	<script type="text/javascript" th:src="@{/theme/js/encrypt/sendEncrypt.js}"></script>

	<script>
		$(function () {
			if('[[${needLogin}]]'=='true'){
				layer.msg('请先登录！', {time: 1000}, function () {
				});
			}
		})
		layui.use('form', function () {
			var form = layui.form;

			//监听提交
			form.on('submit(formDemo)', function (data) {
				return false;
			});
		});
		function login_btn() {
			var account = $("#loginname").val();
			var password = $("#nloginpwd").val();
			var toPage =  "[[${toPage}]]";
			if(account ==""||password =="") {
				layer.msg('请输入手机号码和密码进行登录！', {time: 1000}, function () {
				});
			}else{
			$.ajax({
				url : "/user/userLogin",
				dataType : "json",
				data :sendEncrypt(JSON.stringify({
							"password" : password , "account" : account
						})),
				async: false,
				contentType: "application/json",
				success: function (data) {
					data=JSON.parse(receiveEncrypt(data));
					if(data["result"]=="ok"){
						layer.msg('登录成功！', {time: 1000}, function () {
							window.location="index";
							//window.location.href=document.referrer;
							// if(''!='[[${toUrl}]]'){
							// 	var toUrl='[[${toUrl}]]'.replace(/&amp;/g,"&");
							// 	window.location=toUrl;
							// }else {
							// 	//返回并刷新
							// 	window.location.href=document.referrer;
							// 	// window.history.back();
							//     // window.history.go(-1);
							// 	// window.location='/index';
							// }

						});
					}else if(data["result"]=="fail"){
						layer.msg('账户或密码错误！', {time: 1000}, function () {
						});
					}else{
						layer.msg('系统错误！', {time: 1000}, function () {
						});
					}
				},
				type : "post"
			});
		}
		}
	</script>
</head>
<body>
<div class="w">
	<div id="logo">
		<div class="header-logo fl" ><h1><a th:href="@{/index}" style="color:#ea4949;">
			<img th:src="@{/myFile/imgold/icon/logo1.png}"style="width:100px;height:80px;"><strong>淘淘商城</strong></a></h1>
		</div>
	</div>

</div>
<div id="content">
  <div class="login-wrap">
  	<div class="w">
  		<div class="login-form">
  			<div class="login-tab-c">账号登录</div>
  			<div class="login-box" style="visibility: visible; display:block">
  			  <div class="mc">
  			  	<div class="form">
  			  		<form action="" id="formlogin" method="post" >
  			  			<div class="item item-fore1 item-error">
  			  				<label for="loginname" class="login-label name-label"></label>
  			  				<input type="text" name="loginname" id="loginname" value="1131233056@qq.com" class="itxt"  tabindex="1" autocomplete="off" placeholder="邮箱/手机号">
  			  				<span class="clear-btn" style="display:inline;"></span>
  			  			</div>
  			  			<!-- 密码输入框fore2 -->
  			  			<div id="entry" class="item item-fore2" style="visibility: visible">
  			  				<label class="login-label pwd-label" for="nloginpwd"></label>
  			  				<input type="password" id="nloginpwd" name="nloginpwd" value="123123" class="itxt itxt-error" tabindex="2" autocomplete="off" placeholder="密码">
  			  				<span class="clear-btn" style="display: inline;"></span>
  			  				<span class="capslock" style="display: none;">
  			  					<b></b>
  			  					大小写锁定已打开
  			  				</span>
  			  			</div>

                        <!-- 自动登录开始fore4 -->
                        <div class="item item-fore4">
                        	<div class="safe">
                        		<span>
                        			<input type="checkbox" name="chkRememberMe" id="autologin" tabindex="3">
                        			<label>自动登录</label>
                        		</span>
                        		<span class="forget-pw-safe">
                        			<a href="">忘记密码</a>
                        		</span>
                        	</div>
                        </div>
                        <!-- 登录按钮开始 -->
                        <div class="item item-fore5">
                        	<div class="login-btn">
                        		<a href="javascript:;" class="btn-img btn-entry" id="loginsubmit" tabindex="6" onClick="login_btn()">登&nbsp;&nbsp;&nbsp;&nbsp;录</a>
                        	</div>
                        </div>
  			  		</form>
  			  	</div>
  			  </div>
  			</div>
  			<div class="coagent" id="kbCoagent">
  				<ul>
  					<li class="extra-r">
  					   <div class="regist-link">
  						<a href="/register" class="">
  							<b></b>立即注册
  						</a>
  					   </div>
  					</li>
  				</ul>
  			</div>
  		</div>
  	</div>
  	<div class="login-banner" style="background-color: #ea4949">
  		<div class="w">
  			<div id="banner-bg" class="i-inner" style="background-image: url(/myFile/imgold/login/a1.jpg);"></div>
  		</div>
  	</div>
  </div>
</div>
<div class="w">
	<div id="footer-2013">
		<div class="links">
			<a href="">关于我们</a>
			|
			<a href="">联系我们</a>
			|
			<a href="">人才招聘</a>
			|
			<a href="">商家入驻</a>
			|
			<a href="">广告服务</a>
			|
			<a href="">手机京东</a>
			|
			<a href="">友情链接</a>
			|
			<a href="">销售联盟</a>
			|
			<a href="">English site</a>
		</div>
		<div style="padding-left:10px">
			<p style="padding-top:10px; padding-bottom:10px; color:#999">网络文化经营许可证：浙网文[2013]0268-027号| 增值电信业务经营许可证：浙B2-20080224-1</p>
			<p style="padding-bottom:10px; color:#999">信息网络传播视听节目许可证：1109364号 | 互联网违法和不良信息举报电话:0571-81683755</p>
		</div>
	</div>
</div>

</body>


</html>